Skip to content

Conversation

@vincentsarago
Copy link
Member

Q:

  • should we validate the entire dataset
  • should we validate all the variables
  • if a dataset if valide, does all the variables are?

My knowledge of Xarray dataset structure is limited so would love some help on this 🙏

@maxrjones
Copy link
Member

Q:

  • should we validate the entire dataset
  • should we validate all the variables

My knowledge of Xarray dataset structure is limited so would love some help on this 🙏

Could specific data variable be included as a query parameter and all data variables are validated if not a specific one is not queried? E.g., if someone knows they will want to tile precipitation they would likely not want to go through the effort to validate all the DataArrays in the Dataset.

  • if a dataset if valide, does all the variables are?

No, as one common example the CRS information when using rioxarray is often stored in a crs data variable which is not valid for titiler even though the dimensions and coordinates of the dataset are valid:
image

@vincentsarago
Copy link
Member Author

🙏 @maxrjones

Right now the I have added the variable= option which will validate a specific variable, if not present it will try to validate the whole dataset.

If I understand well, when variable is not set, you'll iterate through all the variables and return something like

{
    "var1": {
        "compatible_with_titiler": true,
        "errors": []
    },
    "var2": {
        "compatible_with_titiler": false,
        "errors": [
            "Dataset does not have compatible spatial coordinates"
        ]
    },
    ...
}

@maxrjones
Copy link
Member

This approach seems good for short-term use, though eventually it would be nice to use a schema validation approach (e.g., https://github.com/xarray-contrib/xarray-schema) rather than eagerly applying the operations to save time and memory.

My main concern is about the validation and io code becoming out of sync. Could one or more utility functions be defined for some of the code in https://github.com/developmentseed/titiler/blob/main/src/titiler/xarray/titiler/xarray/io.py#L96-L202 for use in both io and validate to mitigate that chance?

It also looks like the metadata and variable extensions are becoming redundant. Is the separate Variable extension still needed?

@vincentsarago
Copy link
Member Author

updated with a variables=... options (allowing multiple variables), if not it will run the validation for all variables

http://127.0.0.1:8080/validate?url=https://nasa-power.s3.us-west-2.amazonaws.com/syn1deg/temporal/power_syn1deg_monthly_temporal_lst.zarr&variables=AIRMASS_00&variables=AIRMASS_01

{
  "AIRMASS_00": {
    "compatible_with_titiler": true,
    "errors": [],
    "warnings": []
  },
  "AIRMASS_01": {
    "compatible_with_titiler": true,
    "errors": [],
    "warnings": []
  }
}

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TiTiler performance Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 1c76de3 Previous: 38f884d Ratio
WebMercator longest_transaction 0.07 s 0.05 s 1.40

This comment was automatically generated by workflow using github-action-benchmark.

@vincentsarago vincentsarago marked this pull request as ready for review November 13, 2025 20:44
@vincentsarago
Copy link
Member Author

My main concern is about the validation and io code becoming out of sync. Could one or more utility functions be defined for some of the code in https://github.com/developmentseed/titiler/blob/main/src/titiler/xarray/titiler/xarray/io.py#L96-L202 for use in both io and validate to mitigate that chance?

@maxrjones I didn't change this part, might do in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants